import request from 'src/axios'

/**
 * @description 分页查询库位信息列表
 * @param { Object } params 查询参数
 * @returns Promise
 */
export const pageWarehouseLocation = (params: object) => {
  return request.get('/wms/warehouseLocation/page', { params })
}

/**
 * @description 查询所有库位信息
 * @param { Object } params 查询参数
 * @returns Promise
 */
export const listWarehouseLocation = (params?: object) => {
  return request.get('/wms/warehouseLocation/list', { params })
}

/**
 * @description 查看库位信息
 * @param { String } id 主键
 * @returns Promise
 */
export const viewWarehouseLocation = (id: string) => {
  return request.get('/wms/warehouseLocation', { params: { id } })
}

/**
 * @description 新增库位信息
 * @param { Object } data 新增数据
 * @returns Promise
 */
export const saveWarehouseLocation = (data: object) => {
  return request.post('/wms/warehouseLocation', data)
}

/**
 * @description 修改库位信息
 * @param { Object } data 修改数据
 * @returns Promise
 */
export const updateWarehouseLocation = (data: object) => {
  return request.put('/wms/warehouseLocation', data)
}

/**
 * @description 删除库位信息
 * @param { Array<string> } ids 主键数组
 * @returns Promise
 */
export const deleteWarehouseLocation = (ids: Array<string>) => {
  return request.delete('/wms/warehouseLocation', { data: ids })
}

/**
 * @description 启用库位信息
 * @param { String } id 主键
 * @returns Promise
 */
 export const enableWarehouseLocation = (id: string) => {
  return request.put('/wms/warehouseLocation/enable', { id })
}

/**
 * @description 禁用库位信息
 * @param { String } id 主键
 * @returns Promise
 */
export const disableWarehouseLocation = (id: string) => {
  return request.put('/wms/warehouseLocation/disable', { id })
}
